<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <!-- 2. 引入vuejs -->
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
  </head>

  <body>
    <!-- 1. 准备容器 -->
    <div id="app">
      <!-- 4. 渲染数据 -->
      <h3>小黑的旅行</h3>
    <ul>
      <li v-for="(item, index) in booksList">
        <span>{{ item}}</span>
        <!-- <span>{{ item.author }}</span> -->
        <!-- 注册点击事件 →  通过 id 进行删除数组中的 对应项 -->
       
      </li>
      <button @click="move">走一走</button>
    </ul>
    </div>
    <script>
      // 3. 创建Vue实例
      const app = new Vue({
        el: "#app",
        data: {
            
            booksList:['美女','猿猴','帅哥']
        },
        methods: {
            move(){
                this.booksList.push(this.booksList[0])
                 this.booksList.splice(this.booksList[0],1)
                 
            }
        },
      });
    </script>
  </body>
</html>
